import cn from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import s from './style.module.css';

function Label({ className, note, children }) {
	return (
		<div className={cn(className, s.label)}>
			{children}
			{note && <span className={s.note}>{note}</span>}
		</div>
	);
}

Label.propTypes = {
	className: PropTypes.string,
	note: PropTypes.node,
	children: PropTypes.node.isRequired,
};
Label.defaultProps = {
	className: s.Label,
};

export default Label;
